import React from 'react'
import {Navigate} from 'react-router-dom'
import type {RouteObject} from 'react-router-dom'

const Discover = React.lazy(()=>import('@/views/discover/discover'))
const My = React.lazy(()=>import('@/views/my/my'))
const Follow = React.lazy(()=>import('@/views/follow/follow'))
const DownLoad = React.lazy(()=>import('@/views/download/download'))
const Recommend = React.lazy(()=>import('@/views/discover/component/recommend/recommend'))
const Dj = React.lazy(()=>import('@/views/discover/component/dj/Dj'))
const NewDisc = React.lazy(()=>import('@/views/discover/component/disc/Disc'))
const Rank = React.lazy(()=>import('@/views/discover/component/rank/Rank'))
const Singer = React.lazy(()=>import('@/views/discover/component/singer/Singer'))
const SongList = React.lazy(()=>import('@/views/discover/component/song/Song'))
const routes:RouteObject[] = [
  {
    path: '/',
    element: <Navigate to='/discover'></Navigate>
  },
  {
    path: '/discover',
    element: <Discover />,
    children: [
      {
        path: '/discover',
        element: <Navigate to='/discover/recommend'></Navigate>
      },
      {
        path: '/discover/recommend',
        element: <Recommend/>
      },
      {
        path: '/discover/dj',
        element: <Dj/>
      },
      {
        path: '/discover/disc',
        element: <NewDisc/>
      },
      {
        path: '/discover/rank',
        element: <Rank/>
      },
      {
        path: '/discover/singer',
        element: <Singer/>
      },
      {
        path: '/discover/song',
        element: <SongList/>
      },
    ]
  },
  {
    path: '/my',
    element: <My />
  },
  {
    path: '/follow',
    element: <Follow />
  },
  {
    path: '/download',
    element: <DownLoad />
  },
]
export default routes
